# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=malcontent
pkgver=0.10.1
pkgrel=1
pkgdesc="Parental control support for applications"
url="https://gitlab.freedesktop.org/pwithnall/malcontent"
license=(LGPL2.1)
arch=(x86_64)
depends=(accountsservice dbus flatpak glib2 gtk3 polkit appstream-glib)
makedepends=(git meson gobject-introspection gtk-doc libglib-testing yelp-tools)
provides=(libmalcontent{,-ui}-${pkgver%%.*}.so)
_commit=e0fac336384561c8ba6e1a2d3d1ec109aa921343  # tags/0.10.1^0
source=("git+https://gitlab.freedesktop.org/pwithnall/malcontent.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
  install -d -o root -g 102 -m 750 "$pkgdir/usr/share/polkit-1/rules.d"
}
